home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / Chip Mayıs 2001.iso / prog / share / 07 / ASPFusion / data1.cab / Admin_Pages / Admin / act_websitesecurity.asp < prev    next >
Encoding:
Text File  |  2001-03-25  |  4.5 KB  |  93 lines

  1. <%
  2. on error resume next
  3. dim SecurityBox
  4. if (Session("Index") <> "Index") then
  5.     Response.Redirect "index.asp"
  6. elseif ((Request.Form("Add") = "Add") or (Request.Form("Modify") <> "")) then
  7.         set SecurityBox = Server.CreateObject("AdvFusionBox.FusionBox")
  8.         set Result = SecurityBox.GetAllSectionKeys("WebSite.ini", "Path")
  9.         if (SecurityBox.IsError = 1) then
  10.             Session("Error") = SecurityBox.ErrorReason
  11.             set SecurityBox = nothing
  12.             Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
  13.         end if
  14.         for each Member in Result
  15.             if (rtrim(ltrim(Request.Form("WebSiteName"))) = Member.Key) then
  16.                 Session("Error") = "ASPFusion Security Box with name "&Request.Form("WebSiteName")&" already exist, please supply another name"
  17.                 set Result = nothing
  18.                 set SecurityBox = nothing
  19.                 Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
  20.             end if
  21.         next    
  22.         set Result = nothing
  23.         set Rst = SecurityBox.GetRegVal("", "InstallationPath", "String")
  24.         if (SecurityBox.IsError = 1) then
  25.             Session("Error") = SecurityBox.ErrorReason
  26.             set SecurityBox = nothing
  27.             Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
  28.         end if
  29.         set Result = SecurityBox.ReturnValues("Admin.ini", "Settings", "Applied")
  30.         if (SecurityBox.IsError = 1) then
  31.             Session("Error") = SecurityBox.ErrorReason
  32.             set Rst = nothing
  33.             set SecurityBox = nothing
  34.             Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
  35.         end if
  36.         set File = Server.CreateObject("Scripting.FileSystemObject")
  37.         DspText = ""
  38.         ActText = vbCrLf & "%" & ">"
  39.         JSCodeText = ""
  40.         for each Member in Result
  41.             DspFileName = Rst.Value & "\Admin\dsp_" & Member.Value & ".asp"
  42.             ActFileName = Rst.Value & "\Admin\act_" & Member.Value & ".asp"
  43.             if (File.FileExists(DspFileName) and File.FileExists(ActFileName)) then
  44.                 DspText = DspText & vbCrLf & "<!--- #include file = 'dsp_" & Member.Value & ".asp' --->"
  45.                 ActText = ActText & vbCrLf & "<!--- #include file = 'act_" & Member.Value & ".asp' --->"
  46.                 JSCodeText = JSCodeText & vbCrLf & "if (!" & LCase(Member.Value) & "()) return false;"
  47.             end if
  48.         next
  49.         set Result = nothing
  50.         set File = nothing
  51.         ActText = ActText & vbCrLf & "<" & "%"
  52.         SecurityBox.Insert Rst.Value & "\Admin\dsp_websitesecuritydetail.asp", DspText, "<!--- ASP Include Start Mark --->", "<!--- ASP Include End Mark --->"
  53.         if (SecurityBox.IsError = 1) then
  54.             Session("Error") = SecurityBox.ErrorReason
  55.             set Rst = nothing
  56.             set SecurityBox = nothing
  57.             Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
  58.         end    if
  59.         SecurityBox.Insert Rst.Value & "\Admin\act_websitesecuritydetail.asp", ActText, "'ASP Include Start Mark", "'ASP Include End Mark"
  60.         if (SecurityBox.IsError = 1) then
  61.             Session("Error") = SecurityBox.ErrorReason
  62.             set Rst = nothing
  63.             set SecurityBox = nothing
  64.             Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
  65.         end if
  66.         SecurityBox.Insert Rst.Value & "\Admin\act_websitesecuritydetail.asp", ActText, "'ASP Include Start Mark1", "'ASP Include End Mark1"
  67.         if (SecurityBox.IsError = 1) then
  68.             Session("Error") = SecurityBox.ErrorReason
  69.             set Rst = nothing
  70.             set SecurityBox = nothing
  71.             Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
  72.         end if
  73.         SecurityBox.Insert Rst.Value & "\Admin\index.js", JSCodeText, "/* JS Code Start Mark1 */", "/* JS Code End Mark1 */"
  74.         set Rst = nothing
  75.         if (SecurityBox.IsError = 1) then
  76.             Session("Error") = SecurityBox.ErrorReason
  77.             set SecurityBox = nothing
  78.             Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
  79.         end if
  80.         set SecurityBox = nothing
  81.         if (Request.Form("Add") = "Add") then
  82.             Response.Redirect("dsp_websitesecuritydetail.asp?WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
  83.         else
  84.             Response.Redirect("dsp_websitesecuritydetail.asp?modify=1&WebSiteName="&Replace(Request.Form("Modify"), " ", "%20"))
  85.         end if
  86.     elseif (Request.Form("Logout") = "Logout") then
  87.             Session("Index") = ""
  88.             Session("Error") = ""
  89.             Response.Redirect("index.asp")
  90.         else
  91.             Response.Redirect("index.asp")
  92.         end if
  93. %>